\section{factor --- LU Factorisation}
\label{fn:factor}
\index{factor()}
\index{LU factorisation}
\begin{rail}
Factor : 'factor' '(' Matrix ')' ;
\end{rail}

\verb+factor+ computes the LU factorization of the square,
non-singular argument matrix. It returns a list with 3 elements: 
\begin{description}
        \item{\verb+lu+}  a matrix containing the LU factors
        \item{\verb+pvt+} a vector containing the pivot indices
        \item{\verb+rcond+} the reciprocal of the condition estimate
\end{description}

\verb+factor+ returns the results in the above format, so that they
may be conveniently used with \verb+backsub+ for repetitive
solutions. The \verb+lu+ function uses the results from
\verb+factor+ to produce separate L and U matrices.

\paragraph{Example}
\index{example of factor()}
\index{factor()!example}
\begin{verbatim}
> M = rand(4,4)
 M =
        1     0.0369      0.204       0.91  
    0.975      0.162      0.167      0.112  
    0.647      0.665      0.655      0.299  
    0.333     0.0847      0.129      0.265  
> a = factor(M)
   lu           pvt          rcond        
> a.lu
        1     0.0369      0.204       0.91  
    0.647      0.641      0.523      -0.29  
    0.975      0.196     -0.134     -0.718  
    0.333      0.113    -0.0132    -0.0144  
> a.pvt
        1          3          3          4  
> a.rcond
 0.000436
\end{verbatim}


See also: Page~\pageref{fn:backsub} \verb+backsub()+,
Page~\pageref{fn:inv} \verb+inv()+,
Page~\pageref{fn:solve} \verb+solve()+.

\newpage




